CREATE SEQUENCE public."ChargeCategory_ChargeCategoryId_seq"
    INCREMENT 1
    START 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;

ALTER SEQUENCE public."ChargeCategory_ChargeCategoryId_seq"
    OWNER TO postgres;
-------------------------------------------------------------------------------

-- Table: public.ChargeCategory

-- DROP TABLE public."ChargeCategory";

CREATE TABLE public."ChargeCategory"
(
    "ChargeCategoryId" integer NOT NULL DEFAULT nextval('"ChargeCategory_ChargeCategoryId_seq"'::regclass),
    "LocationId" integer,
    "Active" boolean DEFAULT true,
    "CreatedBy" integer,
    "CreatedDate" timestamp without time zone,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp without time zone,
    "ChargeCategoryName" character varying COLLATE pg_catalog."default",
    CONSTRAINT "ChargeCategory_pkey" PRIMARY KEY ("ChargeCategoryId"),
    CONSTRAINT "ChargeCategory_CreatedBy_fkey" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ChargeCategory_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ChargeCategory_ModifiedBy_fkey" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public."ChargeCategory"
    OWNER to postgres;
	
	
------------------------------------------------------------------------------------------------------	
CREATE SEQUENCE public."ScanTestMaster_ScanTestMasterId_seq"
    INCREMENT 1
    START 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;

ALTER SEQUENCE public."ScanTestMaster_ScanTestMasterId_seq"
    OWNER TO postgres;

--------------------------------------------------------------------------------------------------------

-- Table: public.ScanTestMaster

-- DROP TABLE public."ScanTestMaster";

CREATE TABLE public."ScanTestMaster"
(
    "ScanTestMasterId" bigint NOT NULL DEFAULT nextval('"ScanTestMaster_ScanTestMasterId_seq"'::regclass),
    "ScanTestName" character varying(250) COLLATE pg_catalog."default" NOT NULL,
    "ScanTestCode" character varying COLLATE pg_catalog."default" NOT NULL,
    "Description" character varying(500) COLLATE pg_catalog."default",
    "Active" boolean NOT NULL DEFAULT true,
    "CreatedBy" bigint NOT NULL,
    "CreatedDate" timestamp without time zone NOT NULL,
    "ModifiedBy" bigint,
    "ModifiedDate" timestamp without time zone,
    "Duration" smallint,
    CONSTRAINT "PK_ScanTestMaster_ScanTestMasterId" PRIMARY KEY ("ScanTestMasterId"),
    CONSTRAINT "FK_ScanTestMaster_CreatedBy" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "FK_ScanTestMaster_ModifiedBy" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public."ScanTestMaster"
    OWNER to postgres;
	
------------------------------------------------------------------------------------------------------------------------------------------	
	CREATE SEQUENCE public."LocationScanTestMasterMap_LocationScanTestMasterMapId_seq"
    INCREMENT 1
    START 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;

ALTER SEQUENCE public."LocationScanTestMasterMap_LocationScanTestMasterMapId_seq"
    OWNER TO postgres;
	----------------------------------------------------------------------------------------------------------
	
	-- Table: public.LocationScanTestMasterMap

-- DROP TABLE public."LocationScanTestMasterMap";

CREATE TABLE public."LocationScanTestMasterMap"
(
    "LocationScanTestMasterMapId" bigint NOT NULL DEFAULT nextval('"LocationScanTestMasterMap_LocationScanTestMasterMapId_seq"'::regclass),
    "LocationId" integer NOT NULL,
    "ScanTestMasterId" integer NOT NULL,
    "Amount" numeric NOT NULL,
    "ChargeCategoryId" integer NOT NULL,
    CONSTRAINT "LocationScanTestMasterMap_pkey" PRIMARY KEY ("LocationScanTestMasterMapId"),
    CONSTRAINT "LocationScanTestMasterMap_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "LocationScanTestMasterMap_ScanTestMaster_fkey" FOREIGN KEY ("ScanTestMasterId")
        REFERENCES public."ScanTestMaster" ("ScanTestMasterId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public."LocationScanTestMasterMap"
    OWNER to postgres;
	
---------------------------------------------------------------------------------------------	
	
	CREATE SEQUENCE public."ScanMachineMaster_ScanMachineMasterId_seq"
    INCREMENT 1
    START 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;

ALTER SEQUENCE public."ScanMachineMaster_ScanMachineMasterId_seq"
    OWNER TO postgres;
	
	
	
	
-----------------------------------------------------------------------------------------------------	
	-- Table: public.ScanMachineMaster

-- DROP TABLE public."ScanMachineMaster";

CREATE TABLE public."ScanMachineMaster"
(
    "ScanMachineMasterId" bigint NOT NULL DEFAULT nextval('"ScanMachineMaster_ScanMachineMasterId_seq"'::regclass),
    "MachineName" character varying COLLATE pg_catalog."default",
    "DisplayName" character varying COLLATE pg_catalog."default",
    "Active" boolean DEFAULT true,
    "CreatedBy" integer,
    "CreatedDate" timestamp(6) without time zone,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp(6) without time zone,
    CONSTRAINT "ScanMachineMaster_pkey" PRIMARY KEY ("ScanMachineMasterId"),
    CONSTRAINT "ScanMachineMaster_CreatedBy_fkey" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ScanMachineMaster_ModifiedBy_fkey" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public."ScanMachineMaster"
    OWNER to postgres;
	
-------------------------------------------------------------------------------------------------------------------------------------	
CREATE SEQUENCE public."ScanMachineTestMap_ScanMachineTestMapId_seq"
    INCREMENT 1
    START 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;

ALTER SEQUENCE public."ScanMachineTestMap_ScanMachineTestMapId_seq"
    OWNER TO postgres;	
-------------------------------------------------------------------------------------------------------------------------
-- Table: public.ScanMachineTestMap

-- DROP TABLE public."ScanMachineTestMap";

CREATE TABLE public."ScanMachineTestMap"
(
    "ScanMachineTestMapId" bigint NOT NULL DEFAULT nextval('"ScanMachineTestMap_ScanMachineTestMapId_seq"'::regclass),
    "ScanMachineMasterId" integer NOT NULL,
    "ScanTestMasterId" integer NOT NULL,
    "LocationId" integer NOT NULL,
    CONSTRAINT "ScanMachineTestMap_pkey" PRIMARY KEY ("ScanMachineTestMapId"),
    CONSTRAINT "ScanMachineTestMap_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ScanMachineTestMap_ScanMachineMasterId_fkey" FOREIGN KEY ("ScanMachineMasterId")
        REFERENCES public."ScanMachineMaster" ("ScanMachineMasterId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ScanMachineTestMap_ScanTestMasterId_fkey" FOREIGN KEY ("ScanTestMasterId")
        REFERENCES public."ScanTestMaster" ("ScanTestMasterId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public."ScanMachineTestMap"
    OWNER to postgres;	
	
	